qbox_img_tool(){
zhuanhuan_img(){
echo "选择转换方式"
read -r -p "1)vmdk→qcow2 2)qcow2→raw 
请选择：" input
case $input in
1)echo "输入原镜像路径"
read ZHUANHUAN_OLD
echo "输入转换后你想保存的路径(包含文件名)"
read ZHUANHUAN_NEW
qemu-img convert -f vmdk -O qcow2 ${ZHUANHUAN_OLD} ${ZHUANHUAN_NEW} ;;
2)echo "输入原镜像路径"
read ZHUANHUAN_OLD
echo "输入转换后你想保存的路径(包含文件名)"
read ZHUANHUAN_NEW
qemu-img convert -f qcow2 -O raw ${ZHUANHUAN_OLD} ${ZHUANHUAN_NEW} ;;
esac
}
chuangjian_img(){
echo "请选择您要创建的格式"
read -r -p "1)raw 2)qcow2" input
case $input in
1)echo "请输入你镜像要生成到的路径(要包含文件名！)"
read PATH_IMG_A
echo "生成大小？单位G，只输入数字"
read IMG_SIZE
qemu-img create -f raw ${PATH_IMG_A} ${IMG_SIZE}G
qbox_img_tool ;;
2)echo "请输入你镜像要生成到的路径(要包>含文件名！)"
read PATH_IMG_B   
echo "生成大小？单位G，只输入数字"
read IMG_SIZE_B
qemu-img create -f qcow2 ${PATH_IMG_B} ${IMG_SIZE_B}G
qbox_img_tool ;;
esac
}
yasuo_img(){
echo "仅支持qcow2的镜像"
echo "请输入原镜像路径"
read OLD_PATH
echo "请输入压缩后文件路径(要包含文件名)"
read NEW_PATH
echo "压缩时间较长，请耐心等待"
qemu-img convert -c -p -f qcow2 ${OLD_PATH} -O qcow2 ${NEW_PATH}
qbox_img_tool
}
echo "欢迎使用镜像工具！"
read -r -p "1)创建空磁盘/镜像
2)压缩镜像
3)转换镜像格式
请选择：" input
case $input in
	1)chuangjian_img ;;
	2)yasuo_img ;;
	3)zhuanhuan_img ;;
esac
}
############
qbox_start_qemu(){
echo "请选择您要使用的架构："
read -r -p "1) i386(适合32位架构 2) x86_64(适合64位架构）
请选择：" input
case $input in
1) QEMU_SYSTEM="$PREFIX/bin/qemu-system-i386" ;;
2) QEMU_SYSTEM="$PREFIX/bin/qemu-system-x86_64" ;;
esac
echo "请选择计算机类型:"
read -r -p " 1)pc 2)q35
请选择：" input
case $input in
1) MACHINE="-machine pc" ;;
2) MACHINE="-machine q35" ;;
esac
echo "选择加速类型："
read -r -p "1)tcg 2)kvm
请选择：" input
case $input in
1) ACCEL="--accel tcg,thread=multi" ;;
2) ACCEL="--accel kvm" ;;
esac
echo "请输入您的系统镜像路径：
请输入："
read PATH
echo "请选择您要的磁盘类型："
read -r -p "1)ide 2)virtio 3)sata 4)nvme
请选择：" input
case $input in
1)DISK_A="-drive file="
DISK_B=",if=ide,index=0,media=disk,aio=threads,cache=writeback" ;;
2)DISK_A="-drive file="
DISK_B=",index=0,media=disk,if=virtio" ;;
3)DISK_A="-drive file="
DISK_B=",if=none,id=disk0 -device ahci,id=SATA -device ide-hd,drive=disk0,bus=SATA.0" ;;
4)DISK_A="-drive file="
DISK_B=",if=none,id=disk0 -device nvme,serial=deadbeef,max_ioqpairs=64,msix_qsize=64,mdts=10,physical_block_size=2MB,drive=disk0" ;;
esac
moredisk_open(){
echo "已启用双硬盘"
echo "输入您多磁盘的磁盘路径
请输入："
read PATH_A
echo "请选择您要的磁盘类型："
read -r -p "1)ide 2)virtio 3)sata 4)nvme
请选择：" input
case $input in
1)DISK_A_1=" -drive file="
DISK_B_1=",if=ide,index=1,media=disk,aio=threads,cache=writeback" ;;
2)DISK_A_1=" -drive file="
DISK_B_1=",index=1,media=disk,if=virtio" ;;
3)DISK_A_1=" -drive file="
DISK_B_1=",if=none,id=disk1 -device ahci,id=SATA -device ide-hd,drive=disk1,bus=SATA.0" ;;
4)DISK_A_1=" -drive file="
DISK_B_1=",if=none,id=disk1 -device nvme,serial=deadbeef,max_ioqpairs=64,msix_qsize=64,mdts=10,physical_block_size=2MB,drive=disk1" ;;
esac
}
moredisk_close(){
echo "双硬盘已禁用"
PATH_A=""
DISK_A_1=""
DISK_B_1=""
}
echo "启用双磁盘？"
read -r -p "1)开启 2)不开启
请选择：" input
case $input in
1)moredisk_open ;;
2)moredisk_close ;;
esac
morecdrom(){
echo "启用第二个cdrom？"
read -r -p "1)启用 2)不启用" input
case $input in
1)echo "请输入第二cdrom路径"
read MORECDROM_PATH
MORECDROM_A=" -drive file="
MORECDROM_B=",index=3,media=cdrom" ;;
2)echo "已关闭多cdrom"
MORECDROM_PATH=""
MORECDROM_A=""
MORECDROM_B="" ;;
esac
}
echo "启用cdrom？"
read -r -p "1)启用 2)不启用
请选择：" input
case $input in
1)DISK_CDROM=" -cdrom"
echo "请输入路径："
read CDROM_PATH
morecdrom ;;
2)DISK_CDROM="" ;;
esac
echo "请选择您需要的网卡"
read -r -p "1)rtl8139 2)e1000 3)virtio 4)不加载
请选择： " input
case $input in
1)NETWORK_CARD=" -net user -net nic,model=rtl8139" ;;
2)NETWORK_CARD=" -net user -net nic,model=e1000" ;;
3)NETWORK_CARD=" -net user -net nic,model=virtio" ;;
4)NETWORK_CARD="" ;;
esac
echo "请选择您要的声卡"
read -r -p "1)sb16 2)hda 3)ac97 4)不加载
请选择：" input
case $input in
1)SOUND_CARD=" -device sb16" ;;
2)SOUND_CARD=" -device hda" ;;
3)SOUND_CARD=" -device ac97" ;;
4)SOUND_CARD="" ;;
esac
echo "输入需要的内存大小，仅输入数字即可，单位mb
请输入："
read ARM
echo "选择您需要的cpu"
read -r -p "1)core2duo 2)qemu32 3)qemu64 4)max(推荐)
请选择： " input
case $input in
1)CPU="-cpu core2duo" ;;
2)CPU="-cpu qemu32" ;;
3)CPU="-cpu qemu64" ;;
4)CPU="-cpu max,level=0xd,vendor=GenuineIntel" ;;
esac
echo "请选择显卡"
read -r -p "1)cirrus 2)vmware 3)vga 4)virtio
请选择："
case $input in
1)VGA="-device cirrus-vga" ;;
2)VGA="-device vmware-svga" ;;
3)VGA="-device VGA" ;;
4)VGA="-device virtio-vga" ;;
esac
cpuauto_open(){
HEXING="4"
XIANCHENG="2"
CACAO="1"
}
cpuauto_close(){
echo "请输入cpu核心数"
read HEXING
echo "请输入cpu线程数"
read XIANCHENG
echo "输入插槽数"
read CACAO
}
echo "自动配置还是手动配置cpu的，核心，线程，插槽？"
read -r -p "1)自动 2)手动
请选择：" input
case $input in
1)cpuauto_open ;;
2)cpuauto_close ;;
esac
echo "开启共享文件夹？"
read -r -p "1)开 2)不开
请选择：" input
case $input in
1)SHARE=" -hdd fat:rw:"
echo "输入共享文件夹路径，不能超过500mb"
read SHARE_PATH ;;
2)SHARE=""
SHARE_PATH="" ;;
esac
echo "连接方式？"
read -r -p "1)vnc 2)spice
请选择：" input
case $input in
1)echo "使用vnc软件链接127.0.0.1:0"
CONNECT=" -vnc :0" ;;
2)echo "使用spice软件链接127.0.0.1:5900"
CONNECT=" -spice port=5900,addr=127.0.0.1,disable-ticketing=on,seamless-migration=off" ;;
esac
echo "鼠标跟随开启？"
read -r -p "1)开启 2)不开启
请选择：" input
case $input in
1)USB_MOUSE=" -machine usb=on -device usb-kbd -device usb-tablet" ;;
2)USB_MOUSE="" ;;
esac
clear

echo "qemu即将启动"
echo "${QEMU_SYSTEM} ${MACHINE} ${ACCEL} ${DISK_A}${PATH}${DISK_B}${DISK_A_1}${PATH_A}${DISK_B_1}${DISK_CDROM}${CDROM_PATH}${MORECDROM_A}${MORECDROM_PATH}${MORECDROM_B}${NETWORK_CARD}${SOUND_CARD} ${CPU} -smp $[$HEXING*$XIANCHENG*$CACAO],cores=${HEXING},threads=${XIANCHENG},sockets=${CACAO} ${VGA}${SHARE}${SHARE_PATH}${CONNECT}${USB_MOUSE}"
export START="${QEMU_SYSTEM} ${MACHINE} ${ACCEL} ${DISK_A}${PATH}${DISK_B}${DISK_A_1}${PATH_A}${DISK_B_1}${DISK_CDROM}${CDROM_PATH}${MORECDROM_A}${MORECDROM_PATH}${MORECDROM_B}${NETWORK_CARD}${SOUND_CARD} ${CPU} -smp $[$HEXING*$XIANCHENG*$CACAO],cores=${HEXING},threads=${XIANCHENG},sockets=${CACAO} ${VGA}${SHARE}${SHARE_PATH}${CONNECT}${USB_MOUSE}"
#cat <<-EOF
$START
#EOF
exit
}
###############
qbox_install_qemu(){
echo "即将开始安装"
sleep 3
pkg update -y && apt --fix-broken install -y && apt install qemu-system-x86-64-headless qemu-system-i386-headless curl -y
echo "操作结束，可能安装会有问题，重试即可"
}
################
qbox_begin(){
if uname -a | grep -q Android; 
then echo "暂不支持termux环境，请安装linux容器后继续"
sleep 2
termux
else echo "环境检测正常"
sleep 2
fi
echo "欢迎使用QBox for linux（qemu便捷启动脚本）"
if qemu-system-x86_64 --version | grep -q QEMU;
then echo "您已安装Qemu，操作继续"
else echo "您未安装qemu，将开始安装"
qbox_install_qemu
fi
echo "QBox启动成功，请选择您要进行的操作..."
read -r -p "1)启动qemu-system-x86_64模拟器
2)镜像工具
0)退出
仅支持这些功能，其他功能请等待更新！
请选择：" input
case $input in
1)qbox_start_qemu ;;
2)qbox_img_tool ;;
*)exit ;;
esac
}
##############
mirror_change(){
echo "即将安装必要软件。。"
sleep 2
apt install wget
apt install apt-transport-https ca-certificates
localectlset-locale LANG=zh_CN.UTF-8
echo "您的系统版本为："
lsb_release -a
sleep 3
echo "请选择您要更换的系统版本：
1)debian-bullseye
2)debian-buster
注：仅支持这些版本，其他版本等待更新！
温馨提示：请选择正确的版本，选择错误版本会导致换源失败和源无法使用的情况！
自动换源功能正在开发中，请稍候！
请一定要备份sources.list文件！"
read -r -p "请选择：" input 
case $input in
1)mirror_bullseye ;;
2)mirror_buster ;;
esac
}
###########
mirror_bullseye(){
echo "即将开始换源，系统将会备份文件到/etc/apt/sources.list.bf"
sleep 1
echo "为保证更换成功，请在root用户下操作"
sleep 1
cd /etc/apt/
mv sources.list sources.list.bf
touch sources.list
echo 'deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free' >> sources.list
apt update
echo "更换完成"
proot
}
##########
mirror_buster(){
echo "即将开始换源，系统将会备份文件到/etc/apt/sources.list.bf"
sleep 1
echo "为保证更换成功，请在root用户下操作"
sleep 1
cd /etc/apt/
mv sources.list sources.list.bf
touch sources.list
echo 'deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free' >> sources.list
apt update
echo "更换完成"
proot
}
##########
focal(){
cd ubuntu-focal/root/
touch 1.sh
cat >1.sh<<-'eof'
touch ${HOME}/.hushlogin
mkdir -p /run/systemd/resolve 2>/dev/null && echo "nameserver 223.5.5.5
nameserver 223.6.6.6" >/run/systemd/resolve/stub-resolv.conf
echo "是否换源？
1)是
2)否"
read -r -p "请选择：" input
case $input in
1)cd /etc/apt/
cp sources.list sources.list.bf
echo "sources文件已备份，名叫sources.list.bf"
sleep 1
rm -f sources.list
touch sources.list
echo 'deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-security main restricted universe multiverse' >> sources.list
apt update
echo "更换成功" ;;
*)echo "操作取消" ;;
esac
echo "是否安装图形界面和常用软件？
感谢海鲜对本功能的技术支持"
read -r -p "1)是 (图形界面有bug，请勿选择)
2)否
请选择：" input
case $input in
1)apt install -y && apt install --no-install-recommends curl wget vim fonts-wqy-zenhei tar firefox firefox-locale-zh-hans ffmpeg mpv xfce4 xfce4-terminal ristretto dbus-x11 lxtask pavucontrol -y
if [ ! $(command -v dbus-launch) ] || [ ! $(command -v xfce4-session) ]; then
echo -e "\e[31m似乎安装出错,重新执行安装\e[0m"
sleep 2
apt --fix-broken install -y && apt install --no-install-recommends curl wget vim fonts-wqy-zenhei tar firefox firefox-locale-zh-hans ffmpeg mpv xfce4 xfce4-terminal ristretto dbus-x11 lxtask pavucontrol -y
fi
if [ $(command -v firefox) ]; then
if grep -q '^ex.*MOZ_FAKE_NO_SANDBOX=1' /etc/environment; then
printf "%s\n" "MOZ_FAKE_NO_SANDBOX=1" /etc/environment
else
echo 'export MOZ_FAKE_NO_SANDBOX=1' >>/etc/environment
fi
if ! grep -q 'PATH' /etc/environment; then
sed -i '1i\PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"' /etc/environment
fi
if ! grep -q 'environment' /etc/profile; then
echo 'source /etc/environment' >>/etc/profile
fi
fi
apt install tightvncserver
echo "输入tightvncserver启动" ;;
2)echo "操作取消" ;;
esac
echo "更换语言为中文？"
read -r -p "1)是
2)否
请选择：" input
case $inpit in
1)apt install fonts-wqy-zenhei locales -y
sed -i '/zh_CN.UTF/s/#//' /etc/locale.gen
locale-gen || /usr/sbin/locale-gen
sed -i '/^export LANG/d' /etc/profile && sed -i '1i\export LANG=zh_CN.UTF-8' /etc/profile && source /etc/profile && export LANG=zh_CN.UTF-8 && echo '修改完毕,请重新登录';;
2)echo "操作取消" ;;
esac
eof
echo "启动系统后，请输入chmod +x 1.sh&&./1.sh配置 "
echo "操作结束"
}
install_proot(){
echo "安装必要软件"
apt update
apt install proot
read -r -p "请选择你要安装的系统：
1)debian-bullseye(作者:海)
2)ubuntu(anlinux)
3)ubuntu-focal(自创)
请选择：" input
case $input in
1)apt install pulseaudio
bash -c "$(curl https://cdn.jsdelivr.net/gh/chungyuhoi/script/bullseye.sh)" ;;
2)echo -e "安装即将开始！如果速度较慢请尝试科学上网！"
sleep 5
pkg install wget openssl-tool proot -y && hash -r && wget https://raw.githubusercontent.com/EXALAB/AnLinux-Resources/master/Scripts/Installer/Ubuntu/ubuntu.sh && bash ubuntu.sh
echo -e "安装完成，输入./start-debian.sh 启动" ;;
3)cd
apt install wget
#VERSION=`curl https://mirrors.bfsu.edu.cn/lxc-images/images/ubuntu/focal/arm64/default/ | grep href | tail -n 2 | cut -d '"' -f 4 | head -n 1`
curl -O https://mirrors.bfsu.edu.cn/lxc-images/images/ubuntu/focal/armhf/default/20211001_07%3A42/rootfs.tar.xz
mkdir ubuntu-focal
tar xvf rootfs.tar.xz -C ubuntu-focal
echo $(uname -a) | sed 's/Android/GNU\/Linux/' >ubuntu-focal/proc/version
if [ ! -f "ubuntu-focal/usr/bin/perl" ]; then

        cp ubuntu-focal/usr/bin/perl* ubuntu-focal/usr/bin/perl
fi
cat >ubuntu-focal/usr/bin/uptime<<-'eof'
sed -n "/load average/s/#//;s@$(grep 'load average' /usr/bin/uptime | awk '{print $2}' | sed -n 1p)@$(date +%T)@"p /usr/bin/uptime
eof
touch start-ubuntu.sh
cat >start-ubuntu.sh<<-'eof'
unset LD_PRELOAD
proot --kill-on-exit -S ubuntu-focal --link2symlink -b /sdcard:/root/sdcard -b /sdcard -b ubuntu-focal/root:/dev/shm -w /root /usr/bin/env -i HOME=/root TERM=$TERM USER=root PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/games:/usr/local/games LANG=C.UTF-8 /bin/bash --login
eof
cd
rm -f rootfs.tar.xz
echo "安装完成！输入./start-ubuntu.sh启动"
chmod +x start-ubuntu.sh
focal ;;
esac
}
##############
termux(){
echo -e "\e[33m欢迎使用termux工具脚本\e[0m"
read -r -p "目录：
 1)制作恢复包 
 2)恢复恢复包
 3)安装linux容器
 4)给termux换源
 5)启动Qbox
 0)取消操作
 说明：恢复包保存在/storage/emulated/0文件夹下（就是手机根目录），名为huifu.tar.gz 
 如果使用2，解压恢复包，请将您需要解压的恢复包放到/storage/emulated/0文件夹下，并重命名位huifu.tar.gz
 请选择：" input
case $input in
1)cd /data/data/com.termux
tar zcvf huifu.tar.gz files
cp huifu.tar.gz /sdcard
echo -e "操作已完成" 
termux;;
2)echo -e "请确认恢复包已放到指定位置，5s后恢复即将开始！"
sleep 5
cd /data/data/com.termux/
cp /sdcard/huifu.tar.gz .
tar zxvf huifu.tar.gz
echo -e "操作已完成"
termux ;;
3)install_proot ;;
4)echo -e "准备开始换源...."
sleep 1
sed -i 's@^\(deb.*stable main\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/termux-packages-24 stable main@' $PREFIX/etc/apt/sources.list
sed -i 's@^\(deb.*games stable\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/game-packages-24 games stable@' $PREFIX/etc/apt/sources.list.d/game.list
sed -i 's@^\(deb.*science stable\)$@#\1\ndeb https://mirrors.tuna.tsinghua.edu.cn/termux/science-packages-24 science stable@' $PREFIX/etc/apt/sources.list.d/science.list
apt update && apt upgrade
termux ;;
5)qbox_begin ;;
*)echo -e "已取消"
exit ;;
esac
}
#########
proot(){
echo "为了正常使用脚本，启动时会自动更新源"
sleep 3
apt update
echo "\e[33m欢迎使用容器脚本(beta重制版)，本教本仅支持Ubuntu和debian\e[33m！
菜单：
1)更换国内源
2)安装中文语言
3)樱花内网穿透
4)启动Qbox
0)退出
版本更新，功能正在慢慢迁移中。。"
begin(){
             read -r -p "请选择" input
             case $input in
             1) mirros ;;
             2) zh_cn ;;
             3)frp ;;
             4)qbox_begin ;;
             *) end ;;
             esac
             begin
}

zh_cn(){
apt install fonts-wqy-zenhei -y
sed -i "/zh_CN.UTF/s/#//" /etc/locale.gen
sed -i "2i\export LANG=zh_CN.UTF-8" /etc/profile
locale-gen
exit
}
end(){
echo "操作已取消"
exit
}
minecraft-server(){
echo "请选择您要安装mc服务器的版本！
1)java版 1.12.2
0)退出
ps：该脚本位测试版，有bug请见谅，目前仅支持这些版本！"
read -r -p "请选择：" input
case $input in
     1)echo "开始安装"
       sleep 1
       mkdir mcjava
       apt-get install default-jre
       cd
       cd mcjava
       wget https://storage-space-1.gitee.io/minecraftserver/1.12.2/1.12.2server.jar
       echo "尝试第一次启动"
       sleep 1
       java -Xmx1024m -Xms1024m -jar 1.12.2server.jar
       echo "开始配置文件"
       sleep 1
       rm -f eula.txt
       rm -f server.properties
       wget https://shell.xb8888.top/mcserver/java/eula.txt
       wget https://shell.xb8888.top/mcserver/java/server.properties
       cd
       echo "配置已完成，输入cd mcjava&&java -Xmx1024m -Xms1024m -jar 1.12.2server.jar"
       sleep 2
       exit
esac
}
frp(){
wget https://getfrp.sh/d/frpc_linux_arm64
chmod +x frpc_linux_arm64
./frpc_linux_arm64
}

begin
}
########
#echo "更新公告2021/9/5：
#本脚本已完全重写和更改，比原来好多了，不在是三个文件，脚本已经整合，因为我还是个小白，所以这个脚本写的不好，请多多见谅！"
#echo "2021/9/19:
#脚本暂时停更"
#echo "2021/9/21：脚本破例更新一次，下次更新估计是国庆节？"
#echo "最新公告2021/9/25:将于国庆节开始编写Qbox脚本(qemu便捷启动脚本)   敬请期待！"
echo "脚本版本：0.0.3.3"
echo "更新内容："
#2021/9/5：脚本重写 功能减少
#echo "2021/9/21:中秋节破例更新，更新了容器安装，可一键配置！"
#echo "2021/9/24：删除部分失效功能，优化换源方式！"
#echo "qbox编写完成，目前仅一个功能，其他功能请等待更新，欢迎反馈bug！"
#echo "2021/10/3 已修复无法自动运行qemu的bug，感谢群员提供的解决方式
#已更新多cdrom
echo "2021/10/5 QBox工具已趋于完善"
sleep 3
echo "正在检查您处于的环境，请稍候"
if uname -a | grep -q Android; 
then echo "您现在处于termux环境中，正在为您加载相关脚本，请稍候..."
sleep 2
termux
else echo "您处于容器环境中，正在加载相关脚本！"
sleep 2
proot
fi